<?php
namespace Home\Controller;
use Think\Controller;
class LoginController extends Controller {
    public function index(){
        $this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>欢迎使用 <b>ThinkPHP</b>！</p><br/>版本 V{$Think.version}</div><script type="text/javascript" src="http://ad.topthink.com/Public/static/client.js"></script><thinkad id="ad_55e75dfae343f5a1"></thinkad><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script>','utf-8');
    }
    public function Tijiao() {
        $this->display();
        
    }
    public function Tijiaodo() {
        $data['name']= I('post.name');
        $data['phone']= I('post.phone');
        $data['type']= I('post.title');
        $data['Jointime']=time();
        $User = M("User");
        $haha = $User->add($data) ;
     $this->redirect('Login/tijiao');
    }
    public function Login() {
        $this->display();
        
        
        
    }
    public function logindo() {
        
        $data['name']=I('post.name');
        $data['pass']=I('post.pass');
        
        if($data==null){
           
            $this->ajaxReturn(0);
            
        }else{
            $User = M("admin");
            $ret=$User->where($data)->find();
          
            if($ret==null){
              $this->ajaxReturn(0);  
                
            }else{
                session('name','hahah');
               $this->ajaxReturn(1);  
            }
            
            
        }
        
    }
    public function employmentshow() {
//        $username = "zongsadasdzi"; 
//        echo substr_replace($username,'**','1','2'); 
        
        
$User = M('employment'); // 实例化User对象

// 进行分页数据查询 注意page方法的参数的前面部分是当前的页数使用 $_GET[p]获取
$list = $User->page($_GET['p'].',5')->select();
$this->assign('list',$list);// 赋值数据集
$count      = $User->count();// 查询满足要求的总记录数
$Page       = new \Think\Page($count,5);// 实例化分页类 传入总记录数和每页显示的记录数
$show       = $Page->show();// 分页显示输出
$this->assign('page',$show);// 赋值分页输出
$this->display(); // 输出模板
    
    }
    
    
    
}